module.exports = `
  enum ShowType {
    invisible
    normal
    pin
  }

  input TagPayload {
    # Name of the tag
    name: String!
    # folder = true, tag = false or null
    isFolder: Boolean
    # The parent folder id
    folderId: ID
    # The show option of the tag: -1 = invisible, 0 = normal, >= 1 = pinned
    show: ShowType
  }

  type Tag {
    id: ID!
    name: JSON
    isFolder: Boolean
    show: ShowType
    searchCount: Int
    tags: [Tag]
  }

  extend type Query {
    # 获取所有标签，如果有相应参数就加入过滤。name参数用模糊匹配方式%name%, show参数为 ShowType
    tags(name: String, folderId: ID, show: ShowType): [Tag]
  }

  extend type Mutation {
    # 创建标签
    createTag(input: TagPayload!): Tag
    # 修改标签显示方式
    pinTag(id: ID!, show: ShowType!): Tag
    # 删除标签
    removeTag(id: ID!): Tag
  }

`
